﻿<UserControl x:Class="MediaSurfaceV2.SearchUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    MaxHeight="475"  Background="Transparent" MinHeight="475"  MaxWidth="850" MinWidth="850" xmlns:my="http://schemas.microsoft.com/surface/2008" Margin="20" Padding="5" Height="360" Width="760" Opacity="1">

    <UserControl.Resources>
        <ImageBrush x:Key="WindowBackground" Stretch="Fill" Opacity="1" ImageSource="C:\Users\admin\Desktop\MediaSurfaceV2\MediaSurfaceV2\Resources\16.jpg"/>
        <Style x:Key="LibraryControlInScatterViewItemContentStyle" TargetType="{x:Type my:ScatterViewItem}">
            <Setter Property="MinWidth" Value="{Binding Path=Content.MinWidth, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MinHeight" Value="{Binding Path=Content.MinHeight, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MaxWidth" Value="{Binding Path=Content.MaxWidth, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="MaxHeight" Value="{Binding Path=Content.MaxHeight, RelativeSource={RelativeSource Self}, Mode=OneWay}"/>
            <Setter Property="IsActive" Value="{Binding Path=Content.IsActive,RelativeSource={RelativeSource Self}, Mode=OneWayToSource}"/>
            <Setter Property="Width" Value="{Binding Path=Content.Width, RelativeSource={RelativeSource Self}, Mode=TwoWay}"/>
            <Setter Property="Height" Value="{Binding Path=Content.Height, RelativeSource={RelativeSource Self}, Mode=TwoWay}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type my:ScatterViewItem}">
                        <ContentPresenter />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="BarItemStyle" TargetType="{x:Type my:LibraryBarItem}">
            <Style.Triggers>
                <Trigger Property="my:LibraryBarItem.IsItemDataEnabled" Value="False">
                    <Setter Property="my:LibraryBarItem.Padding" Value="5"/>
                    <Setter Property="my:LibraryBarItem.Background" Value="Blue"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>

    <DockPanel Height="410" Width="783">
        <my:LibraryBar DockPanel.Dock="Top"    Name="libraryBar2" Width="730" Height="163" Rows="1" AllowDrop="False" ItemContainerStyle="{StaticResource BarItemStyle}" FontFamily="SimSun" FontSize="16">
        	<my:LibraryBar.Background>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="Black" Offset="0"/>
        			<GradientStop Color="#FF605F5F" Offset="1"/>
        		</LinearGradientBrush>
        	</my:LibraryBar.Background>
        	<my:LibraryBar.Foreground>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="Black" Offset="0"/>
        			<GradientStop Color="White" Offset="1"/>
        		</LinearGradientBrush>
        	</my:LibraryBar.Foreground>
            <my:LibraryBar.ItemTemplate>
                <DataTemplate>
                	<Grid Name="infoView">
                		<Grid.RowDefinitions>
						     <RowDefinition Height="75" />
						     <RowDefinition Height="25" />
						</Grid.RowDefinitions>
						<Grid.ColumnDefinitions>
						     <ColumnDefinition Width="120" />
						</Grid.ColumnDefinitions>
						<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Text="{Binding Path=title}" TextWrapping="Wrap" Grid.Row="1" FontSize="12" Grid.Column = "0" />        	
						<Image Name="thumnailImage" Width="120" Height="120"  Margin="5" Source="{Binding Path=thumbnailUrl}" Grid.Row="0" Grid.Column = "0"></Image>
					</Grid>
                </DataTemplate>
            </my:LibraryBar.ItemTemplate>

        </my:LibraryBar>
        <my:SurfaceButton Name="searchButton" VerticalAlignment="Center" HorizontalAlignment="Center" Width="100" Height="40" DockPanel.Dock="Top" Click="SurfaceButton_Click" FontSize="12" FontWeight="Bold" Foreground="White">
        	<my:SurfaceButton.Background>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="Black" Offset="0"/>
        			<GradientStop Color="#FF605F5F" Offset="1"/>
        		</LinearGradientBrush>
        	</my:SurfaceButton.Background>Search</my:SurfaceButton>
        <my:SurfaceButton Name="hideSearchButton" VerticalAlignment="Center" HorizontalAlignment="Center" Width="100" Height="40" DockPanel.Dock="Top" Click="Hide_SurfaceButton_Click" FontSize="12" FontWeight="Bold" ForceCursor="False" Foreground="White">
        	<my:SurfaceButton.Background>
        		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        			<GradientStop Color="Black" Offset="0"/>
        			<GradientStop Color="#FF605F5F" Offset="1"/>
        		</LinearGradientBrush>
        	</my:SurfaceButton.Background>Hide</my:SurfaceButton>


<Border x:Name="SearchBorder" CornerRadius="50" Margin="8,0,0,33.393" Width="574"  ForceCursor="True" OpacityMask="#FF000064">

            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">

                    <GradientStop Color="Black" Offset="0"/>

                    <GradientStop Color="#FF605F5F" Offset="1"/>

                </LinearGradientBrush>
            </Border.Background>

<StackPanel Name="SearchStackPanel" Height="180" Width="707"  DockPanel.Dock="Bottom" Margin="5" Orientation="Horizontal" VerticalAlignment="Center">
                <Label VerticalAlignment="Center" Foreground="red" FontWeight="Bold">Search</Label>
                <my:SurfaceListBox Margin="3"  Background="Transparent" Height="100" Width="150"  Foreground="Yellow" Name="searchOptionSurfaceListBox" ScrollViewer.HorizontalScrollBarVisibility ="Disabled" ScrollViewer.VerticalScrollBarVisibility="Visible" AllowDrop="False" VerticalAlignment="Center" SelectionChanged="searchOption_ListBoxChanges"  FontSize="11" FontWeight="Bold" ForceCursor="False" Grid.IsSharedSizeScope="True" HorizontalAlignment="Center" HorizontalContentAlignment="Left" MaxHeight="Infinity" ToolTip="Select to Search">
                    <my:SurfaceListBoxItem Foreground="White" Height="20" Name="surfaceListBoxItem1" Width="120">My Media</my:SurfaceListBoxItem>
                    <my:SurfaceListBoxItem Foreground="White" Height="20" Name="surfaceListBoxItem6" Width="120">Friends Media</my:SurfaceListBoxItem>

                    <my:SurfaceListBoxItem Foreground="White" Height="20" Name="surfaceListBoxItem2" Width="120">All</my:SurfaceListBoxItem>
                    <my:SurfaceListBoxItem Foreground="White" Height="20" Name="surfaceListBoxItem3" Width="120">Letter</my:SurfaceListBoxItem>
                    <my:SurfaceListBoxItem Foreground="White" Height="20" Name="surfaceListBoxItem4" Width="120">Tag</my:SurfaceListBoxItem>
                    <my:SurfaceListBoxItem Foreground="White" Height="20" Name="surfaceListBoxItem5" Width="120">Title</my:SurfaceListBoxItem>


                </my:SurfaceListBox>
                <my:SurfaceListBox Foreground="White"  Height="100" Width="150" Name="surfaceListBox2" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Disabled"  AllowDrop="False" VerticalAlignment="Center" HorizontalAlignment="Right" SelectionChanged="surfaceListBox2_SelectionChanged" Background="Transparent" FontWeight="Bold"></my:SurfaceListBox>
                <my:SurfaceTextBox Foreground="Black" Background="White"  Name="searchTextBox" Height="22" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Right" Width="180" TextChanged="searchTextBox_TextChanged" />

            </StackPanel>

        </Border>

    </DockPanel>

</UserControl>
